<?php
/**
 * 模型：角色
 */

 namespace app\model;

 use think\Model;

 class Role extends Model{
    //定义与用户的多对多关联
    public function users(){
        return $this->belongsToMany(User::class,'user_role','role_id','user_id');
    }
 }